{if !empty($email)}
{eval $_TPL['title'][]=$email['title'];}
{/if}
{eval $_TPL['title'][]='邮件模板设置';}
{template header}
<div id="content">
    <h5>设置：邮件模板设置</h5>
    {if !empty($emaillist)}
    <p>你可以在这里设置给用户发送相关邮件模板，下面是模板列表</p>
    <ul>
        {loop $emaillist $email}
        <li><a href="setup.php?ac=email&id={$email['id']}">{$email['title']}</a></li>
        {/loop}
    </ul>
    {else}
    <p>{$email['title']}</p>
    <form id="emailform" action="setup.php?ac=email&id={$email['id']}" method="post">
        <input type="hidden" name="formhash" value="{$_SGLOBAL['formhash']}"/>
        <input type="hidden" name="emailsubmit" value="true"/>
        <table class="form_table" cellpadding="0" cellspacing="0">
            <tr>
                <th>标题：</th>
                <td><input type="text" class="i_input" name="subject" value="{$email['subject']}"/></td>
            </tr>
            <tr>
                <th>内容：</th>
                <td>
                    <p>
                        <span class="important_string">%username%</span>-客户的用户名<br/>
                        <span class="important_string">%nickname%</span>-昵称<br/>
                        <span class="important_string">%company_name%</span>-公司名
                    </p>
                    <textarea class="i_input" name="content" cols="80" rows="20">{$email['content']}</textarea>
                </td>
            </tr>
            <tr>
                <th>&nbsp;</th>
                <td>
                    <input id="emailsubmit" type="button" value="修改" class="i_submit"/>
                    <span id="emailchange"></span>
                </td>
            </tr>
        </table>
    </form>
    <script type="text/javascript">
        $(function(){
            $("#emailsubmit").click(function(){
                ajaxform('emailform','emailchange');
            });
        });
    </script>
    {/if}
</div>
<div id="siber_icon"><img src="template/default/image/g_prefs_big.jpg"/></div>
<div class="clear"></div>
{template footer}
